import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
  routes: [{
    path: '/',
    redirect: '/doingObject'
  },
  {
    path: '/',
    component: () => import( /* webpackChunkName: "home" */ '../components/common/Home.vue'),
    meta: {
      title: '自述文件'
    },
    children: [
      //修改密码
      {
        path: '/editPassWord',
        component: () => import( /* webpackChunkName: "donate" */ '../components/pages/EditPassword.vue'),
        meta: {
          title: '修改密码'
        }
      },
      //生产运营部,新项目
      {
        path: '/newObjectList',
        component: () => import( /* webpackChunkName: "donate" */ '../components/pages/newObjectList.vue'),
        meta: {
          title: '新项目',
          newObj: true
        }
      },
      {
        path: '/doingObject',
        component: () => import( /* webpackChunkName: "donate" */ '../components/pages/doingObject.vue'),
        meta: {
          title: '进行中项目',
        }
      },
      {
        path: '/history',
        component: () => import( /* webpackChunkName: "donate" */ '../components/pages/history.vue'),
        meta: {
          title: '历史项目',
          history: true
        }
      },
      {
        path: '/newDepartment',
        component: () => import( /* webpackChunkName: "donate" */ '../components/pages/newDepartment.vue'),
        meta: {
          title: '账号管理',
          newObj: true
        }
      },
      //项目部-进行中的项目-审核未通过
      {
        path: '/doingProjectFail',
        component: () => import( /* webpackChunkName: "donate" */ '../components/pages/doingProjectFail.vue'),
        meta: {
          title: '进行中项目'
        }
      },
      // //项目部-进行中的项目-审核未通过备份
      // {
      //     path: '/doingProjectFailCopy',
      //     component: () => import(/* webpackChunkName: "donate" */ '../components/pages/doingProjectFailCopy.vue'),
      //     meta: { title: '进行中项目', }
      // }

    ]
  },
  {
    path: '/404',
    component: () => import( /* webpackChunkName: "donate" */ '../components/pages/404.vue'),
    meta: {
      title: '404'
    }
  },
  //统一登录首页
  {
    path: '/tongyiindex',
    component: () => import( /* webpackChunkName: "tongyiindex" */ '../components/tongyipage/index.vue'),
    meta: {
      title: '系统入口首页',
    },
    redirect: '/systementrance',
    children: [
      //系统入口
      {
        path: '/systementrance',
        component: () => import( /* webpackChunkName: "donate" */ '../components/tongyipage/system_entrance.vue'),
        meta: {
          title: '系统入口'
        }
      },
      //用户管理
      {
        path: '/userMang',
        component: () => import( /* webpackChunkName: "donate" */ '../components/tongyipage/userMang.vue'),
        meta: {
          title: '系统入口'
        }
      },
      //组织管理
      {
        path: '/organizationalmanagement',
        component: () => import( /* webpackChunkName: "donate" */ '../components/tongyipage/organizational_management.vue'),
        meta: {
          title: '组织管理'
        }
      },//角色管理
      {
        path: '/rootmanagement',
        component: () => import( /* webpackChunkName: "donate" */ '../components/tongyipage/root_management.vue'),
        meta: {
          title: '角色管理'
        }
      },
    ]
  },
  // 成本管理
  {
    path: '/costmanagement',
    component: () => import( /* webpackChunkName: "login" */ '../components/costManagement/Home.vue'),
    meta: {
      title: '成本管理'
    },
    redirect: '/cosdoningPro',
    children: [
      // 新项目
      {
        path: '/costnewobjectlist',
        component: () => import( /* webpackChunkName: "donate" */ '../components/costManagement/newObjectList.vue'),
        meta: {
          title: '新项目'
        }
      },
      // 模板管理
      {
        path: '/template',
        component: () => import( /* webpackChunkName: "donate" */ '../components/costManagement/template.vue'),
        meta: {
          title: '模板管理'
        }
      },// 新增模板
      {
        path: '/addtemplate',
        component: () => import( /* webpackChunkName: "donate" */ '../components/costManagement/addtemplate.vue'),
        meta: {
          title: '添加模板'
        }
      },
      { // 历史项目
        path: '/coshistory',
        component: () => import( /* webpackChunkName: "donate" */ '../components/costManagement/history.vue'),
        meta: {
          title: '历史项目'
        }
      },
      { // 进行中项目
        path: '/cosdoningPro',
        component: () => import( /* webpackChunkName: "donate" */ '../components/costManagement/cosdoningPro.vue'),
        meta: {
          title: '进行中项目'
        }
      }
    ]
  },
  {
    path: '/login',
    component: () => import( /* webpackChunkName: "login" */ '../components/pages/Login.vue'),
    meta: {
      title: '登录'
    }
  },
  {
    path: '*',
    redirect: '/404'
  }
  ]
});